<?php

/*
 * 数据挖掘
 * lin
 */

class UserProduct_Collect {
    /*
     * 数据表名
     */
    const TABLE_NAME = 'userproduct';

    /**
     * cache namaspace
     */
    const CACHE_NS = 'pid';

    /**
     * session user id namaspace
     */
    const SESSION_ID = 'UId';

    /**
     * 缓存实例
     *
     * @var Helper_Cache_Memcache
     */
    protected $_cacheInstance;
    
    /**
     * db实例
     *
     * @var Helper_Cache_Memcache
     */
    protected $_dbInstance;
    
    /**
     * 单例对象
     */
    public static $singletonObjects;

    /**
     * 获取单例
     */
    public static function getInstance() {
        $className = __CLASS__;
        if (!isset(self::$singletonObjects[$className])) {
            self::$singletonObjects[$className] = new self();
        }

        return self::$singletonObjects[$className];
    }

    /**
     * 构造器
     *
     * @param
     */
    protected function __construct() {

        $this->_cacheInstance = $this->_getCache();
        $this->_dbInstance = $this->_getMysql();
    }

    /*
     * 获取cache实例
     */

    public function _getCache() {

        return Common::getCache();
    }

    /*
     * 获取db实例
     */

    public function _getMysql() {

        return Common::getMysql();
    }
    
    /**
     * 获取cache数据
     */
    
    public function getCacheValue (  ) {
        
        
        return $this->_cacheInstance -> get (self::CACHE_NS) ;
        
        
    }
    
    

}

?>
